#!/usr/bin/python
import MySQLdb

def connectDB():    
    connect=MySQLdb.connect(host="localhost",port=3306,user="cloud",passwd="cloudpass",db="cloud")
    return connect

def cursorDB(connect):        
    conn=connect.cursor()
    return conn

def closeConnect(connect):
    connect.close()

def closeCursor(cursor):
    cursor.close()

def exeFetchCommand(conn,query):
    cnt = conn.execute(query)
    rows = conn.fetchall()
    return (cnt,rows)

def exeSetCommand(conn,query):
    cnt = conn.execute(query)
    return cnt
